using System;

namespace Me.Prettyprint.Hector.Api.Locking
{
    /// <summary>
    /// Observer interface for lock events
    /// </summary>
	public interface HLockObserver
	{
        /// <summary>
        /// We timed out waiting for the lock
        /// </summary>
        /// <param name="hlock"></param>
		void Timeout(HLock hlock);
        /// <summary>
        /// The lock is acquired
        /// </summary>
        /// <param name="hlock"></param>
        void Acquired(HLock hlock);
        /// <summary>
        /// The lock is released
        /// </summary>
        /// <param name="hlock"></param>
        void Release(HLock hlock);
        /// <summary>
        /// The lock was lost/disconnected.  This should be treated as a fail state, and the lock should be re-acquired
        /// </summary>
        /// <param name="hlock"></param>
        void Disconnected(HLock hlock);
	}
}